Threads of execution, or as they are more commonly termed “threads”, are a way for a program to fork (or split) itself into two or more simultaneously (or pseudo-simultaneously) running tasks. While threads of execution and processes can differ from one operating system to another, threads nonetheless are generally contained within a process and different threads of the same process typically share some resources whereas disparate processes conventionally do not share resources. Threads of execution nevertheless are similar to processes and multiple threads can be executed in parallel on most computer systems by way of multithreading that generally occurs by time slicing. On single processor systems the kernel employs time slicing to provide an illusion of simultaneity of thread execution in much the same way that the kernel utilizes time slicing with processes. On multiprocessor or multi-core systems, in contrast, threads can be run simultaneously on disparate processors or cores thereby providing true parallel processing.
One method for obtaining information to construct call trees is typically to record the method names in a call stack as a frame is entered into or exits, pushing and popping the method names onto and off a call stack as appropriate, and thereafter to use the respective call stack enters and exists to construct the call tree.